//
//  CircleView.m
//  YUXiu
//
//  Created by wang on 16/6/25.
//  Copyright © 2016年 Wang. All rights reserved.
//

#import "CircleView.h"

@implementation CircleView

//kscreenWidth/3,100
-(id)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    
    if (self) {
        
        
        UIButton *btn = [[UIButton alloc]initWithFrame:krect(kScreenWidth/6-33, 15, 66, 66)];
        [btn setBackgroundImage:[UIImage imageNamed:@"header"] forState:UIControlStateNormal];
        [btn addTarget:self action:@selector(clickTap) forControlEvents:UIControlEventTouchUpInside];
        btn.layer.cornerRadius = 33;
        btn.layer.masksToBounds = YES;
        [self addSubview:btn];
        
        _titleLabel = [[UILabel alloc]initWithFrame:krect(0, 0, 50, 20)];
        _titleLabel.font = Font(14);
        _titleLabel.textColor = kBlackCOLOR;
        [self addSubview:_titleLabel];
        
        [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            //
            make.centerX.equalTo(btn);
            make.top.equalTo(btn.mas_bottom).with.offset(0);
        }];
        
        
    }
    
    return self;
}

-(void)layoutSubviews{
    
    _titleLabel.text = _str;
}

-(void)clickTap{
   
    if (_block) {
        _block(_str);
    }
}





@end
